<?php

class Application_Model_DbTable_Auth extends Zend_Db_Table_Abstract
{

    protected $_name = 'auth_table';
public function getUser($username){
    
    	$row = $this->fetchAll($this->select()->where('username = ?',$username));
    	return $row;
    	
    
    }
    
    public function isPresent($username){
    	
    	$select = $this->select()->where('username = ?',$username);
    	$row = $this->fetchAll($select);
    	if($row == null){
    		return null;
    	}else{
    		return $row;
    	}
    }
    

    
    
    public function isLogged(){
    
		    
    
    }
	
    public function createUser($username,$password){
    	
    	$row = $this->createRow();
    	$row->user_id = md5($username.$password);
    	$row->username = $username;
    	$row->password = $password;
    		
    	$row->save;
    
    }

}

